package com.lilong.jwt.common.base;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Getter;
import lombok.Setter;

import javax.jdo.annotations.Column;
import javax.persistence.*;
import java.io.Serializable;

/**
 * 实体类的通用方法
 */
@Setter
@Getter
@MappedSuperclass
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id", scope = Long.class)
public abstract class BaseEntity implements Serializable {
    @Transient
    private static final long serialVersionUID = 1L;
    @Transient
    protected static final String NOT_NULL="不可以为空！";
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;
    @Column(name="create_id")
    private Long createId;
    @Column(name="create_time")
    private Long createTime;
    @Column(name="update_id")
    private Long updateId;
    @Column(name="update_time")
    private Long updateTime;
}
